package zwz.importTask.enums;

public enum ImportAndExportTaskEnum {
    IMPORT_USER_MESSAGE(1, "typeAImportStrategy", "测试用户导入"),
    EXPORT_USER_MESSAGE(2, "typeAExportStrategy", "测试菜单");

    /**
     * 导入导出类型
     */
    private final Integer type;
    /**
     * 导入导出策略
     */
    private final String importStrategy;
    /**
     * 菜单名称
     */
    private final String menuName;

    ImportAndExportTaskEnum(Integer type, String importStrategy, String menuName) {
        this.type = type;
        this.importStrategy = importStrategy;
        this.menuName = menuName;
    }

    public Integer getType() {
        return type;
    }


    public String getImportStrategy() {
        return importStrategy;
    }

    public String getMenuName() {
        return menuName;
    }

    public static String getStrategyByType(Integer type) {
        if (null == type) {
            return "";
        }
        for (ImportAndExportTaskEnum task : ImportAndExportTaskEnum.values()) {
            if (task.getType().equals(type)) {
                return task.getImportStrategy();
            }
        }
        return "";
    }

    public static String getMenuNameByType(Integer type) {
        if (null == type) {
            return "";
        }
        for (ImportAndExportTaskEnum task : ImportAndExportTaskEnum.values()) {
            if (task.getType().equals(type)) {
                return task.getMenuName();
            }
        }
        return "";
    }

}
